package com.lilixia.util;

public class Test {

	public static void main(String[] args) {
		String plainFile = "F:/1/DES.c";
		String keyStr = "F:/1/key.txt";
		String encoded = "F:/1/Encoded.txt";
		String desocded = "F:/1/Decoded.c";
		int result = DES.Encrypt(plainFile, keyStr, encoded);
		System.out.println(result);
		result = DES.Decrypt(encoded, keyStr, desocded);
		System.out.println(result);

		try {
			String test = "Hellow Word!";
			// DESPlus des = new DESPlus();//默认密钥
			DESPlus des = new DESPlus("123");// 自定义密钥
			System.out.println("加密前的字符：" + test);
			System.out.println("加密后的字符：" + des.encrypt(test));
			System.out.println("解密后的字符：" + des.decrypt(des.encrypt(test)));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
